$import("com.joypard.workflow.process.ProcessView");

K.defCtrl("com.joypard.workflow.process.ProcessCtrl", {
	view : null,
	initialize : function() {
		this.view = ProcessView.instance();
		E.addListener("getProcessInstanceDetails",
				this.onGetProcessInstanceDetails, this);
	},

	onGetProcessInstanceDetails : function(r, b) {
		var me = this, input = K.input({
			params : {
				processInstanceId : r.get('id')
			},
			success : (function(b) {
				return function(text) {
					E.fireEvent("getProcessInstanceDetailsSuccessEvent", text,
							b);
				}
			})(b)
		});
		K.service(ProcessDI.urls.getProcessDetails, input);
	}
});